
***Replication Files for "Nationalism, Status, and Conspiracy Theories: Evidence from Pakistan"
***by Asfandyar Mir and Niloufer Siddiqui 
***and its supplementary appendix 

***To be used with nat_misinfo.dta 

*** SCC install

ssc install slideplot
ssc install coefplot
ssc install leebounds
ssc install cibar


** Begining of data preparation

***Creat dummies for treatment groups

gen chauvinist_nat=1 if treat_r==1
replace chauvinist_nat=0 if treat_r!=1

gen cohesive_nat=1 if treat_r==2
replace cohesive_nat=0 if treat_r!=2

gen legitimacy_nat=1 if treat_r==3
replace legitimacy_nat=0 if treat_r!=3

gen control=1 if treat_r==4
replace control=0 if treat_r!=4

gen any_treatment=1 if treat_r!=4
replace any_treatment=0 if treat_r==4

***rename and clean up variables 

rename q3a1 facebook
rename q3a2 whatsapp
rename q3a3 twitter
rename q3a4 youtube
rename q3a5 tiktok

label variable facebook "facebook"
label variable whatsapp "whatsapp"
label variable youtube "youtube"
label variable twitter "twitter"
label variable tiktok "tiktok"

gen social_media_consumer=1 if facebook==1 & whatsapp==1 & youtube==1 & tiktok==1 & twitter==1
replace social_media_consumer=0 if social_media_consumer==.

gen at_least_form_soc = (facebook==1 | whatsapp==1 | youtube==1 | tiktok==1 | twitter==1)

rename q7a democracy
gen pref_dem=1 if democracy==1
replace pref_dem=0 if democracy!=1

rename q8c trust_religions
replace trust_religions=. if trust_religions>4

gen pref_military=1 if democracy==2
replace pref_military=0 if democracy!=2

rename D3 education
rename D4 language
rename D5 income
renam D6 religion
rename D7 sect
rename D8 pol_party
rename d1 gender
rename d2 age

gen PTI_supporter=1 if pol_party==2
replace PTI_supporter=0 if pol_party!=2

gen Punjab=1 if province==1
replace Punjab=0 if province!=1

gen india_hawk=1 if q6==2
replace india_hawk=0 if q6!=2

gen Sunni=1 if sect==2
replace Sunni=0 if Sunni==.

replace education=. if education>8

gen Pashtun=1 if language==6
replace Pashtun=0 if language!=6

gen Sindh=1 if province==2 
replace Sindh=0 if province!=2

gen Punjabi=1 if language==2
replace Punjabi=0 if language!=2

gen Balochistan=1 if province==4
replace Balochistan=0 if province!=4

replace income=. if income>6
replace religion=. if religion>3

replace language=. if language>8

gen Baloch_speakers=1 if language==4
replace Baloch_speakers=0 if language!=4

gen pres_right=1 if q5==1
replace pres_right=0 if q5!=1

gen intolerant=1 if trust_religions==4
replace intolerant=0 if trust_religions!=4

gen tolerant=1 if trust_religions==1
replace tolerant=0 if trust_religions!=1

gen high_intl_esteem=1 if q7b==1
replace high_intl_esteem=0 if q7b!=1

gen Shia=1 if sect==1
replace Shia=0 if sect!=1

rename q9f Pak_peaceful
replace Pak_peaceful=. if Pak_peaceful>4

gen age_18_29 = (age >= 18 & age < 29)

gen age_29_49 = (age >= 29 & age < 49)

gen age_49_above = (age >= 49)

gen pride=T1_4
replace pride=T2_4 if pride==.
replace pride=T3_4 if pride==.

replace pride=. if pride>10

gen anger = q10
replace anger = . if anger>10

***Outcome measures

rename q9b PTM
rename q9e Baloch_separatist

**Create new variable if no response to outcome measures was given 

gen PTM_nr=1 if PTM>4
replace PTM_nr=0 if PTM_nr==.

gen Baloch_nr=1 if Baloch_separatist>4
replace Baloch_nr=0 if Baloch_nr==.

***Get rid of NRs for analysis 
replace PTM=. if PTM>4
replace Baloch_separatist=. if Baloch_separatist>4

***Create binary variables

gen PTM_binary=1 if PTM==1 | PTM==2
replace PTM_binary=0 if PTM==3 | PTM==4

gen Baloch_binary=1 if Baloch_separatist==1 | Baloch_separatist==2
replace Baloch_binary=0 if Baloch_separatist==3 | Baloch_separatist==4

***Recode outcome measures so that higher numbers mean greater belief in misinfo
gen PTM_recode=1 if PTM==4
replace PTM_recode=2 if PTM==3
replace PTM_recode=3 if PTM==2
replace PTM_recode=4 if PTM==1

label define inc 1 "Not at all accurante" 2 "Not very accurate" 3 "Somewhat accurate" 4 "Very accurate"
label values PTM_recode inc

gen Baloch_recode=1 if Baloch_separatist==4
replace Baloch_recode=2 if Baloch_separatist==3
replace Baloch_recode=3 if Baloch_separatist==2
replace Baloch_recode=4 if Baloch_separatist==1

label define inc2 1 "Not at all accurante" 2 "Not very accurate" 3 "Somewhat accurate" 4 "Very accurate"
label values Baloch_recode inc2


lab def any_treatment 0 "Control" 1 "Treatment"
lab val any_treatment any_treatment

***Dichotomized variable

gen PTM_accurate=1 if PTM==1 | PTM==2
replace PTM_accurate=0 if PTM==3 | PTM==4

gen Baloch_accurate=1 if Baloch_separatist==1 | Baloch_separatist==2
replace Baloch_accurate=0 if Baloch_separatist==3 | Baloch_separatist==4

***recode data so NR is a 3 on a 5-point scale
gen PTM_fivepoint=1 if PTM==4
replace PTM_fivepoint=2 if PTM==3
replace PTM_fivepoint=3 if PTM==.
replace PTM_fivepoint=4 if PTM==2
replace PTM_fivepoint=5 if PTM==1

gen Baloch_fivepoint=1 if Baloch_separatist==4
replace Baloch_fivepoint=2 if Baloch_separatist==3
replace Baloch_fivepoint=3 if Baloch_separatist==.
replace Baloch_fivepoint=4 if Baloch_separatist==2
replace Baloch_fivepoint=5 if Baloch_separatist==1

gen nat = control
recode nat (1=0) (0=1)

gen interact_1 = any_treatment*intolerant
gen interact_2 = any_treatment*india_hawk
gen interact_3 = any_treatment*high_intl_esteem
gen interact_4 = any_treatment*pref_military 

**************************************************************************************************************

*** Replication of results

** Table 4 

tab any_treatment PTM_binary , m r

tab any_treatment Baloch_binary , m r


* Figure 3

* Section A and B

slideplot hbar Baloch_recode, neg(1 2) pos(3 4) by(any_treatment) bar(1, bcolor(blue*0.4)) bar(2, bcolor(blue*0.8)) bar(3, bcolor(red*0.4))  bar(4, bcolor(red*0.8))  legend(row(1)) legend(size(vsmall)) percent title("Belief in Accuracy of Conspiracy Theory about Baloch Minority", size(normal))
graph export "$output/Figure_3_section_A.png", replace

slideplot hbar PTM_recode, neg(1 2) pos(3 4) by(any_treatment) bar(1, bcolor(blue*0.4)) bar(2, bcolor(blue*0.8)) bar(3, bcolor(red*0.4))  bar(4, bcolor(red*0.8))  legend(row(1)) legend(size(vsmall)) percent title("Belief in Accuracy of Conspiracy Theory about PTM", size(normal))
graph export "$output/Figure_3_section_B.png", replace

* Table 5

reg PTM_recode any_treatment, robust
estimates store PTM, title (PTM)

reg PTM_recode chauvinist_nat if control==1|chauvinist_nat==1, robust
est sto ptm_cha_est, title (PTM)

reg PTM_recode cohesive_nat if control==1|cohesive_nat==1, robust
estimates store ptm_coh_est, title (PTM)
 
reg PTM_recode legitimacy_nat if control==1|legitimacy_nat==1, robust
estimates store ptm_leg_est, title (PTM)

reg Baloch_recode any_treatment, robust
estimates store Baloch, title (Baloch)

reg Baloch_recode chauvinist_nat if control==1|chauvinist_nat==1, robust
estimates store baloch_cha_est, title (Baloch)

reg Baloch_recode cohesive_nat if control==1|cohesive_nat==1, robust
estimates store baloch_coh_est, title (Baloch)

reg Baloch_recode legitimacy_nat if control==1|legitimacy_nat==1, robust
est sto baloch_leg_est,  title (Baloch)

* Outsheeting table

lab var any_treatment "Pooled treatment"
lab var chauvinist_nat "Chauvinist Nationalism"
lab var cohesive_nat "Cohesive Nationalism"
lab var legitimacy_nat "Legitimacy Nationalism"

outreg2 [PTM ptm_cha_est ptm_coh_est ptm_leg_est Baloch baloch_cha_est baloch_coh_est baloch_leg_est] using "$output/Table_5.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

* Figure 4

reg PTM_recode chauvinist_nat if control==1|chauvinist_nat==1, robust
est sto ptm_cha_est

reg Baloch_recode chauvinist_nat if control==1|chauvinist_nat==1, robust
est sto baloch_cha_est

reg PTM_recode legitimacy_nat if control==1|legitimacy_nat==1, robust
est sto ptm_leg_est

reg Baloch_recode legitimacy_nat if control==1|legitimacy_nat==1, robust
est sto baloch_leg_est

reg PTM_recode cohesive_nat if control==1|cohesive_nat==1, robust
est sto ptm_coh_est

reg Baloch_recode cohesive_nat if control==1|cohesive_nat==1, robust
est sto baloch_coh_est

coefplot (ptm_cha_est,label(PTM Subversive)) (baloch_cha_est,label(Baloch Subversive)),bylabel(Chauvinistic Nationalism)  || (ptm_coh_est,label(PTM Subversive)) (baloch_coh_est,label(Baloch Subversive)),bylabel(Cohesive Nationalism)  || (ptm_leg_est,label(PTM Subversive)) (baloch_leg_est,label(Baloch Subversive)),bylabel(Int'l Legitimacy Nationalism) xline(0) drop(_cons) byopts(row(1)) xsize(11) xtitle("Effect of Different Types of Nationalism Primes on Belief in Conspiracy Theories (Compared to No Prime)")
graph export "$output/Figure_4.png", replace


* Table 6 

lab var intolerant "Intolerant"
lab var india_hawk "India Hawk"
lab var high_intl_esteem "High Int'l Esteem"

lab var interact_1 "Treatment*Intolerant"
lab var interact_2 "Treatment*India Hawk"
lab var interact_3 "Treatment*High Int'l Esteem"

reg PTM_recode any_treatment intolerant interact_1, robust
estimates store tol_PTM
reg PTM_recode any_treatment india_hawk interact_2, robust
estimates store ind_PTM
reg PTM_recode any_treatment high_intl_esteem interact_3, robust
estimates store int_PTM
reg PTM_recode any_treatment pref_military interact_4, robust
estimates store mil_PTM

reg Baloch_recode any_treatment intolerant interact_1, robust
estimates store tol_Baloch
reg Baloch_recode any_treatment india_hawk interact_2, robust
estimates store ind_Baloch
reg Baloch_recode any_treatment high_intl_esteem interact_3, robust
estimates store int_Baloch
reg Baloch_recode any_treatment pref_military interact_4, robust
estimates store mil_Baloch


outreg2 [ tol_PTM ind_PTM int_PTM mil_PTM tol_Baloch ind_Baloch int_Baloch mil_Baloch] using "$output/Table_6.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)


****************
*** APPENDIX ***
****************

************
* Table A2 *
************

* Column 1 Min, Max

foreach var in gender age Urban_Rural Shia Punjab social_media_consumer education pres_right trust_religions PTI Pashtun{

	qui sum `var'
	di "`var': (`r(min)',`r(max)')"
	
	}


* Column 2 - Chauvinistic Treatment

foreach var in gender age Urban_Rural Shia Punjab social_media_consumer education pres_right trust_religions PTI Pashtun{

	qui ttest `var' if chauvinist_nat==1 | control ==1, by(control) unequal


	local mean_diff = `r(mu_1)'-`r(mu_2)'
	local mean_diff = round(`mean_diff', .001)

	if `r(p)' > 0 {
		local mean_diff_final = "`var': `mean_diff' ***"
		}
		
	if `r(p)' > 0.001 {
		local mean_diff_final = "`var': `mean_diff' **"
		}
		
	if `r(p)' > 0.01 {
		local mean_diff_final = "`var': `mean_diff' *"
		}
		
	if `r(p)' > 0.05 {
		local mean_diff_final = "`var': `mean_diff' +"
		}
		
	if `r(p)' > 0.1 {
		local mean_diff_final = "`var': `mean_diff'"
		}

	di "`mean_diff_final'"
	
	}
	

* Column 3 - Cohesive Treatment

foreach var in gender age Urban_Rural Shia Punjab social_media_consumer education pres_right trust_religions PTI Pashtun{

	qui ttest `var' if cohesive_nat==1 | control ==1, by(control) unequal


	local mean_diff = `r(mu_1)'-`r(mu_2)'
	local mean_diff = round(`mean_diff', .01)

	if `r(p)' > 0 {
		local mean_diff_final = "`var': `mean_diff' ***"
		}
		
	if `r(p)' > 0.001 {
		local mean_diff_final = "`var': `mean_diff' **"
		}
		
	if `r(p)' > 0.01 {
		local mean_diff_final = "`var': `mean_diff' *"
		}
		
	if `r(p)' > 0.05 {
		local mean_diff_final = "`var': `mean_diff' +"
		}
		
	if `r(p)' > 0.1 {
		local mean_diff_final = "`var': `mean_diff'"
		}

	di "`mean_diff_final'"
	
	}


* Column 4 - Legitimacy Treatment

foreach var in gender age Urban_Rural Shia Punjab social_media_consumer education pres_right trust_religions PTI Pashtun{

	qui ttest `var' if legitimacy_nat==1 | control ==1, by(control) unequal


	local mean_diff = `r(mu_1)'-`r(mu_2)'
	local mean_diff = round(`mean_diff', .01)

	if `r(p)' > 0 {
		local mean_diff_final = "`var': `mean_diff' ***"
		}
		
	if `r(p)' > 0.001 {
		local mean_diff_final = "`var': `mean_diff' **"
		}
		
	if `r(p)' > 0.01 {
		local mean_diff_final = "`var': `mean_diff' *"
		}
		
	if `r(p)' > 0.05 {
		local mean_diff_final = "`var': `mean_diff' +"
		}
		
	if `r(p)' > 0.1 {
		local mean_diff_final = "`var': `mean_diff'"
		}

	di "`mean_diff_final'"
	
	}
	
* Column 5 - Pooled treatments

foreach var in gender age Urban_Rural Shia Punjab social_media_consumer education pres_right trust_religions PTI Pashtun{

	qui ttest `var', by(control) unequal 


	local mean_diff = `r(mu_1)'-`r(mu_2)'
	local mean_diff = round(`mean_diff', .01)

	if `r(p)' > 0 {
		local mean_diff_final = "`var': `mean_diff' ***"
		}
		
	if `r(p)' > 0.001 {
		local mean_diff_final = "`var': `mean_diff' **"
		}
		
	if `r(p)' > 0.01 {
		local mean_diff_final = "`var': `mean_diff' *"
		}
		
	if `r(p)' > 0.05 {
		local mean_diff_final = "`var': `mean_diff' +"
		}
		
	if `r(p)' > 0.1 {
		local mean_diff_final = "`var': `mean_diff'"
		}

	di "`mean_diff_final'"
	
	}
	
	
************
* Table A3 *
************

tab age_18_29, m
tab age_29_49, m
tab age_49_above, m
tab province
tab gender
tab religion, m
tab income, m
tab education, m
tab q2, m
tab at_least_form_soc, m
tab social_media_consumer, m
tab q6, m


************
* Table A4 *
************

reg Pak_peaceful control, robust 

************
* Table A5 *
************

ttest PTM_recode, by(control) unequal
ttest Baloch_recode, by(control) unequal


************
* Table A6 *
************

foreach var in chauvinist_nat legitimacy_nat cohesive_nat control {

	sum PTM_recode if `var' == 1
	
	}


foreach var in chauvinist_nat legitimacy_nat cohesive_nat control {

	sum Baloch_recode if `var' == 1
	
	}


************
* Table A7 *
************

* We edit the lab var

lab var PTM_accurate "PTM Subversive dichotomized"
lab var Baloch_accurate "Baloch Subversive dichotomized"
lab var any_treatment "Treatment"

reg PTM_accurate any_treatment, robust 
estimates store PTM_dichotomized

reg Baloch_accurate any_treatment, robust 
estimates store Baloch_dichotomized 

outreg2 [PTM_dichotomized Baloch_dichotomized] using "$output/Table_A7.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

************
* Table A7b *
************

reg PTM_accurate chauvinist_nat if control==1|chauvinist_nat==1, robust
estimates store PTM_dichotomized_chauv
reg PTM_accurate cohesive_nat if control==1|cohesive_nat==1, robust
estimates store PTM_dichotomized_coh
reg PTM_accurate legitimacy_nat if control==1|legitimacy_nat==1, robust
estimates store PTM_dichotomized_leg	

reg Baloch_accurate chauvinist_nat if control==1|chauvinist_nat==1, robust
estimates store Baloch_dichotomized_chauv
reg Baloch_accurate cohesive_nat if control==1|cohesive_nat==1, robust
estimates store Baloch_dichotomized_coh
reg Baloch_accurate legitimacy_nat if control==1|legitimacy_nat==1, robust
estimates store Baloch_dichotomized_leg	


outreg2 [PTM_dichotomized_chauv PTM_dichotomized_coh PTM_dichotomized_leg Baloch_dichotomized_chauv Baloch_dichotomized_coh	Baloch_dichotomized_leg] using "$output/Table_A7b.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

************
* Table A8 *
************

lab var any_treatment "Prime"
lab var education "Education"
lab var income "Income"
lab var pres_right "Pol. Knowledge"

lab var PTM_recode "PTM Subversive"
lab var Baloch_recode "Baloch Subversive"


reg PTM_recode any_treatment education income Shia pres_right Punjab
estimates store PTM_dem_controls

reg Baloch_recode any_treatment education income Shia pres_right Punjab
estimates store Baloch_dem_controls

outreg2 [PTM_dem_controls Baloch_dem_controls] using "$output/Table_A6.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

************
* Table A9 *
************


ologit PTM_recode any_treatment
ologit Baloch_recode any_treatment


************
* Table A10 *
************

tab treat_r PTM_nr, r m

tab treat_r Baloch_nr, r m



************
* Table A10b *
************

lab var PTM_nr "PTM Non-Response"
lab var Baloch_nr "Baloch Non-Response"


reg PTM_nr chauvinist_nat cohesive_nat legitimacy_nat, robust
estimates store PTM_nonresponse_all

reg Baloch_nr chauvinist_nat cohesive_nat legitimacy_nat, robust
estimates store Baloch_nonresponse_all

outreg2 [PTM_nonresponse_all Baloch_nonresponse_all] using "$output/Table_A9.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

*************
* Table A10c *
*************

leebounds PTM_recode any_treatment

leebounds Baloch_recode any_treatment



************
* Table A10d *
************

lab var any_treatment "Treatment"

lab var PTM_fivepoint "PTM Subversive Five Point Scale" 
lab var Baloch_fivepoint "Baloch Subversive Five Point Scale" 


reg PTM_fivepoint any_treatment, robust  
estimates store PTM_Five 

reg Baloch_fivepoint any_treatment
estimates store Baloch_Five 

outreg2 [PTM_Five Baloch_Five] using "$output/Table_A7.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)



*************
* Table A11 *
*************


mean PTM_recode if Punjabi == 1
mean PTM_recode if Baloch_speakers == 1
mean PTM_recode if Pashtun == 1

mean Baloch_recode if Punjabi == 1
mean Baloch_recode if Baloch_speakers == 1
mean Baloch_recode if Pashtun == 1

*************
* Table A12 *
*************


ttest PTM_recode if Punjabi == 1, by(control) unequal

ttest Baloch_recode if Punjabi == 1, by(control) unequal

ttest PTM_recode if Baloch_speakers == 1, by(control) unequal

ttest Baloch_recode if Baloch_speakers == 1, by(control) unequal

ttest PTM_recode if Pashtun == 1, by(control) unequal

ttest Baloch_recode if Pashtun == 1, by(control) unequal

*************
* Table A13 *
*************

lab var pride "Pride"

reg pride chauvinist_nat, robust
estimates store chauvinist_pride
reg pride cohesive_nat, robust
estimates store cohesive_pride
reg pride legitimacy_nat, robust
estimates store legitimacy_pride 

outreg2 [chauvinist_pride cohesive_pride legitimacy_pride] using "$output/Table_A13.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

*************
* Table A14 *
*************

lab var anger "Anger"
lab var nat "Nationalism"

reg anger nat, robust
estimates store nat_anger
reg anger chauvinist_nat, robust
estimates store chauvinist_anger
reg anger cohesive_nat, robust
estimates store cohesive_anger
reg anger legitimacy_nat, robust
estimates store legitimacy_anger

outreg2 [nat_anger chauvinist_anger cohesive_anger legitimacy_anger] using "$output/Table_A14.doc", replace alpha(.001, 0.01, .05, .1) symbol (***, **, *, +) label dec(3)

*************
* Figure A15 *
*************


reg PTM_recode any_treatment if high_intl_esteem==1
estimates store g1_ptm

reg PTM_recode any_treatment if high_intl_esteem==0
estimates store g2_ptm

reg Baloch_recode any_treatment if high_intl_esteem==1
estimates store g1_baloch

reg Baloch_recode any_treatment if high_intl_esteem==0
estimates store g2_baloch

coefplot g1_ptm g2_ptm g1_baloch g2_baloch, drop(_cons) aseq swapnames groups(*_ptm = "PTM" *_baloch = "Baloch")
graph export "$output/Figure_5.png", replace

*************
*Figure A16 *
*************

set scheme s2color

lab def high_intl_esteem 0 "Low Int'l Esteem" 1 "High Int'l Esteem"
lab val high_intl_esteem high_intl_esteem

cibar PTM_recode, over1(any_treatment) over2(high_intl_esteem) bargap(25)  ciopts(lcolor(black)) barl(on) blposition(2) graphopts(title("Belief in Accuracy of PTM Conspiracy") ytitle("Mean Belief in Accuracy of PTM Conspiracy") ylabel(1(0.5)3))
graph export "$output/Figure_A16.png", replace


